package br.ufpe.cin.mac.demo.StringServer;

import br.ufpe.cin.mac.middleware.App;
import br.ufpe.cin.mac.middleware.Middleware;
import br.ufpe.cin.mac.nameService.NameServiceClient;
import br.ufpe.cin.mac.util.Constants;
import br.ufpe.cin.mac.util.Message;
import br.ufpe.cin.mac.util.Proxy;

public class StringServer implements App, IStringServer {

	public String getName(String n) {
		System.out.println("Processing msg: " + n);
		return "Server: " + n;
	}

	public double pow(double d) {
		return Math.pow(d, 3);
	}

	public static void main(String obf[]) {
		Middleware mid = new Middleware("server", "Config2.xml");
		new Proxy(new StringServer(), mid);
		 NameServiceClient ns = new NameServiceClient("10.0.0.10");
		 ns.bind(IStringServer.class, String.valueOf(Constants.UDP_PORT));
	}

	public void Notify(Message msg) {

	}
}
